﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UI.Desktop
{
    public partial class frmAltaObraSocial : Form
    {
        public frmAltaObraSocial()
        {
            InitializeComponent();
        }

        #region CERRAR
        private void btnCerrar_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion

        #region GUARDAR OS
        private void btnGuardarOS_Click(object sender, EventArgs e)
        {
            if (txtObraSocial.Text == "")
            {
                MessageBox.Show("Campo invalidos, no puede haber ninguno vacio", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                Business.Entities.ObraSocial enOS = new Business.Entities.ObraSocial();

                enOS.NombreOS = txtObraSocial.Text.ToString();
                enOS.AnyadirObraSocial();

                MessageBox.Show("Obra Social registrada con exito", "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
        }
        #endregion

        private void frmAltaObraSocial_Load(object sender, EventArgs e)
        {

        }
    }
}
